import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:graduation_project/common/screen_body.dart';

import 'found_tabs.dart';

class found_body extends StatefulWidget {
  const found_body({Key key}) : super(key: key);

  @override
  State<found_body> createState() => _found_bodyState();
}

class _found_bodyState extends State<found_body>
    with SingleTickerProviderStateMixin {
  // TabController _controller;
  // var _tabs = <Tab>[];
  @override
  void initState() {
    // _tabs = <Tab>[
    //   Tab(text: "分类"),
    //   Tab(text: "热血"),
    //   Tab(text: "日漫"),
    //   Tab(text: "热番原作"),
    // ];
    super.initState();
    // _controller =
    //     TabController(initialIndex: 1, length: _tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      initialIndex: 1,
      length: 3,
      child: Scaffold(
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(25),
          child: AppBar(
            backgroundColor: Color.fromRGBO(255, 250, 250, 1),
            title: Row(
              children: <Widget>[
                Expanded(
                  child: TabBar(
                      indicatorColor: Color.fromRGBO(255, 250, 250, 1),
                      // indicatorWeight: 0,
                      labelColor: Colors.black87,
                      unselectedLabelColor: Colors.black54,
                      labelStyle: TextStyle(fontSize: 16),
                      unselectedLabelStyle: TextStyle(fontSize: 14),
                      // controller: _controller,
                      tabs: <Tab>[
                        Tab(text: "分类"),
                        Tab(text: "热门"),
                        Tab(text: "日漫"),
                        // Tab(text: "热番原作"),
                      ]),
                )
              ],
            ),
          ),
        ),
        body: TabBarView(
          children: <Widget>[screen_body(), found_tabs(), found_tabs()],
        ),
      ),
    );
  }
}
